import HttpRequest from "../HttpRequestWrapper/HttpRequest";

const SERVER_APP_ID = 4; //自有服务器游戏Id
const apiBaseDomain = '';

let apiRequest = function (uri, data, callback) {
  console.log("apiRequest", uri, data);
  data.version = Global.VERSION;
  data.aId = SERVER_APP_ID;
  let url = apiBaseDomain + uri;
  HttpRequest.postJson(url, data, {
    onSuccess: (res) => {
      callback && callback(null, res);
    },
    onFail: (err) => {
      callback && callback("request error");
    }
  });
};


module.exports = apiRequest;